package god;

import java.util.Scanner;

public class J10Retangle {
	public static void main(String[] args) {
		
		double area = 0, perimeter = 0;
		double width = 0, height = 0;
		String color = "";
		
		// 면적, 둘레 계산
		width = getWidth( makeScanner() );
		height = getHeight( makeScanner() );
		color = getColor( makeScanner() );
		area = getArea( width, height);
		perimeter = getPerimeter(width, height);
		
		System.out.println(width);
		System.out.println(height);
		System.out.println(area);
		System.out.println(perimeter);
		System.out.println(color);
	
	}
	
	public static Scanner makeScanner() {
		Scanner sc = new Scanner(System.in);
		return sc;
	}
	
	public static void closeScanner(Scanner sc) {
		sc.close();
	}
	
	public static double getWidth(Scanner sc) {
		double width;
		System.out.println("가로를 입력해주세요.");
		width = sc.nextInt();
		return width;
	}
	
	public static double getHeight(Scanner sc) {
		double height;
		System.out.println("세로를 입력해주세요.");
		height = sc.nextInt();
		return height;
	}
	
	public static String getColor(Scanner sc) {
		String color;
		System.out.println("색상을 입력해주세요.");
		color = sc.next();
		closeScanner(sc);
		return color;
	}
	
	public static double getArea(double width, double height) {
		return width * height;
	}
	
	public static double getPerimeter(double width, double height) {
		return(width + height) * 2;
	}

}
